<%-- 
    Document   : Category
    Created on : 14-08-2014, 10:37:54
    Author     : NGOCLINH-PC
--%>

<%@page import="sun.awt.geom.AreaOp.CAGOp"%>
<%@page import="Data.Category"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<div class="primarysanpham">
    <div class="menusanpham">
       
    </div>
    <div class="tablesanpham">
        <div class="tablesanpham1">
            <form action="" method="post" name="frm" id="frm">
                <h2 style="padding: 10px; color: #999;">Management Category</h2>
                <hr />
                <li style="list-style: none; padding: 10px 10px 0 10px;"><a href="index.jsp?page=addCategory"><img src="../admin/image/Add.png" alt="add" width="98" height="32"/></a></li>
                <!--<li style="list-style: none; padding: 10px;"><input style="width: 100px; height: 30px;" type="submit" name="btnxoa" value="Delete"/></li>-->
                <table width="100%" border="1" cellspacing="0" cellpadding="4" id="mytable">
                    <tr>
                        <th scope="col">STT</th>
                        <!--<th scope="col"><input name="cball" id="cball" type="checkbox" value="" /></th>-->
                        <th scope="col">Category Name</th>
                        <th scope="col">Status</th>
                        <th scope="col">Actions</th>
                    </tr>
                    <%
                        Category ct = new Category();
                        ArrayList<Category> a = ct.Cselect();
                        int k = 1;
                        if (a.size() > 0) {
                            for (int i = 0; i < a.size(); i++) {
                                Category cate = a.get(i);
                                out.print("<tr>");
                                out.print("<td>" + k++ + "</td>");
                               // out.print("<td><input name='chk' type='checkbox' value='' /></td>");
                                out.print("<td>" + cate.getCategoryName() + "</td>");
                                if (cate.getCstatus() == 1) {
                                    out.print("<td><img src='../admin/image/check.png' alt='check' /></td>");
                                } else {
                                    out.print("<td><img src='../admin/image/No_check.png' alt='no_check' /></td>");
                                }
                                out.print("<td><span class='xoa'><a href='index.jsp?page=addCategory&EcateID=" + cate.getCategoryID() + "'>"
                                        + "<img src='../admin/image/editBtn.gif' alt='editBtn'  /></a>&nbsp;"
                                        + "<a onclick='return confirm(\"Do you want delete!\");' href='../CategoryPR?AcateID=" + cate.getCategoryID() + "'>"
                                        + "<img src='../admin/image/deleteBtn.gif' alt='deleteBtn' /></a></span></td>");
                                out.print("</tr>");
                            }
                        }
                    %>

                </table>
                <div class="pages"></div>
            </form>
        </div>
    </div>
</div>
